#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @project: fastapi-common
# @Author : luzhiheng
# @Date : 2020/10/23
from fastapi import APIRouter
from fastapi_common.api.api_v1.endpoints import user
from fastapi_common.db.base_class import Base
from fastapi_common.db.session import engine

api_router = APIRouter()
api_router.include_router(user.router, prefix="/user", tags=["user"])


@api_router.get("/hello")
async def hello():
    return 'hello'


@api_router.get("/init_db")
async def init_db():
    # Base.metadata.drop_all(engine)
    Base.metadata.create_all(engine)
    return "ok"


